<?php /*
	
*/ ?>
<?php include("system/config.inc.php");
$donotinclude = 1;
if(!isset($_SESSION['adminuserid']))
{
	header("location:index.php?msg=logfirst");
	die();
}

// INSERT into database.
/*if(isset($_REQUEST['Submit']) && trim($_REQUEST['Submit']) == "Submit")
	{
				
				$name=$_REQUEST['sname'];
				$oname=$_REQUEST['oname'];
				$oemail=$_REQUEST['oemail'];
				$from=$_REQUEST['fromemail'];
				$coun=$_REQUEST['country'];
				$zone=$_REQUEST['zone'];
				$orderemail=$_REQUEST['orderemail'];
				$sarea=$_REQUEST['sarea'];
				$insert="INSERT INTO `tblmystore` ( `varstorename` , `varstoreownername` , 
				`varowneremail` , 
				`varfromemail`,`varcountry`,`varzone`,`varsendordertoemail`,`varstoreaddsandphone`) 
				VALUES ('$name','$oname','$oemail','$from','$coun','$zone','$orderemail','$sarea')";
				$sql=$obj_db->insert($insert);
		header("location:store.php?msg=add");
		die();
	}	*/
// UPDATE the record
$p_ss ="";
$p_sm = "";
$p_cs = "";
$p_cm = "";
$p_wls = "";
$p_wlm = "";
$p_pcs = "";
$p_pcm = "";
$p_oss="";
$p_osm="";
$p_nls="";
$p_nlm="";
$p_cntmess="";
$p_wishsub="";
$p_wishmess="";
$action=1;
//if(isset($_REQUEST['Submit']) && trim($_REQUEST['Submit']) == "Update")
 	//if(isset($_REQUEST['intid']) && trim($_REQUEST['intid'])!="")
 	{
			
		$sql = "select * from tblemails";
		$result = $obj_db->select($sql);
		if(count($result)<=0)
		{
			echo " No Record Found!<br>";
			die();
		}
		if($result)
		{
			foreach($result as $row)
			{
				$p_ss = $row['varsignupsub'];	   
		   		$p_sm = $row['txtsignupmess'];
				$p_cs = $row['varcontactsub'];
				$p_cm = $row['txtcontactmess'];
				$p_wls = $row['varwelcomesub'];
				$p_wlm = $row['txtwelcomemess'];
				$p_pcs = $row['varpasssub'];
				$p_pcm = $row['txtpassmess'];
				$p_oss=$row['varstatussub'];
				$p_osm=$row['txtstatusmess'];
				$p_nls=$row['varnewssub'];
				$p_nlm=$row['txtnewmess'];
				$p_cntmess=$row['varcntmess'];
				$p_wishsub=$row['varsubwish'];
				$p_wishmess=$row['txtmesswish'];
				//$action=2;
			}
		}
		if(isset($_REQUEST['Submit']) && trim($_REQUEST['Submit']) == "Update")
		{
				$ss = mysql_real_escape_string($_REQUEST['signupsub']);	   
		   		$sm = mysql_real_escape_string($_REQUEST['smess']);
				$cs = mysql_real_escape_string($_REQUEST['csub']);
				$cm = mysql_real_escape_string($_REQUEST['cmess']);
				$wls = mysql_real_escape_string($_REQUEST['wsub']);
				$wlm = mysql_real_escape_string($_REQUEST['wmess']);
				$pcs = mysql_real_escape_string($_REQUEST['psub']);
				$pcm = mysql_real_escape_string($_REQUEST['pmess']);
				$oss=mysql_real_escape_string($_REQUEST['ossub']);
				$osm=mysql_real_escape_string($_REQUEST['osmess']);
				$nls=mysql_real_escape_string($_REQUEST['nlsub']);
				$nlm=mysql_real_escape_string($_REQUEST['nlmess']);
				$cntmess=mysql_real_escape_string($_REQUEST['contact']);
				$wishsub=mysql_real_escape_string($_REQUEST['wishsub']);
				$wishmess=mysql_real_escape_string($_REQUEST['wishmess']);
			$sql_upd ="UPDATE tblemails SET  
						varsignupsub = '$ss',
						txtsignupmess='$sm',
						varcontactsub='$cs',
						txtcontactmess='$cm',
						varwelcomesub='$wls',
						txtwelcomemess='$wlm',
						varpasssub='$pcs',
						txtpassmess='$pcm',
						varstatussub='$oss',
						txtstatusmess='$osm',
						varnewssub='$nls',
						txtnewmess='$nlm',
						varcntmess='$cntmess',
						varsubwish='$wishsub',
						txtmesswish='$wishmess'";
			$result = $obj_db->edit($sql_upd);
			//$action=1;
			header("location:emailsetting.php?msg=edit");
				die();
			
			
			
}}

?>
<?php include("inc/header.php");?>
<body>


<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" class="middlebackground">
  <tr>
    <td colspan="3" valign="top" align="center"><?php include(INC."top.inc.php");?></td>
  </tr>
  <tr>
    <td width="1%">&nbsp;</td>
    <td width="97%"><form action="" method="post" enctype="multipart/form-data" name="store">

      <table width="80%" border="0" align="center" cellpadding="2" cellspacing="2" class="border">
        <tr class="bg1">
          <td height="20" colspan="5" align="center"><strong>E-Mail Setting ...</strong></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td align="left">&nbsp;</td>
          <td>&nbsp;</td>
          <td align="right">(* All fields are Required)</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td width="2%">&nbsp;</td>
          <td width="45%" align="right" class="sltimg"><strong>*Signup(Email) Subject</strong> <br>
            (For registration confirmation email subject)  </td>
          <td width="2%">:</td>
          <td width="49%" align="left"><label>
            <input name="signupsub" type="text" id="signupsub" value="<?php echo stripslashes($p_ss);?>" />
</label></td>
          <td width="2%">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td align="right" valign="top" class="sltimg"><strong>*Signup(Email) Message</strong> <br>
            (For registration confirmation email message) </td>
          <td valign="top">:</td>
          <td align="left"><textarea name="smess" cols="35" rows="06" id="smess"><?php echo stripslashes($p_sm);?>
          </textarea></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td align="right" class="sltimg"><strong>*Contact (Email)Subject</strong><br>
            ( For contact us  confirmation email subject) </td>
          <td>:</td>
          <td align="left"><input name="csub" type="text" id="csub" value="<?php echo stripslashes($p_cs);?>" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" valign="top" class="sltimg"><strong>*Contact (Email)Message</strong><br>
            ( For contact us  confirmation email message)</td>
          <td align="left" valign="top">:</td>
          <td align="left"><textarea name="cmess" cols="35" rows="06" id="cmess"><?php echo stripslashes($p_cm);?>
          </textarea></td>
          <td align="left">&nbsp;</td>
        </tr>
        <!--<tr>
          <td align="left">&nbsp;</td>
          <td align="right" class="sltimg">*Welcome Subject </td>
          <td align="left">:</td>
          <td align="left"><input name="wsub" type="text" id="wsub" value="<?php echo stripslashes($p_wls);?>" /></td>
          <td align="left">&nbsp;</td>
        </tr>-->
        <!--<tr>
          <td align="left">&nbsp;</td>
          <td align="right" valign="top" class="sltimg">*Welcome Message </td>
          <td align="left" valign="top">:</td>
          <td align="left"><textarea name="wmess" cols="35" rows="06" id="wmess"><?php echo stripslashes($p_wlm);?>
          </textarea></td>
          <td align="left">&nbsp;</td>
        </tr>-->
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" class="sltimg"><strong>*Forgot Password (Email)Subject</strong><br>
            ( For forgot password request recieved   confirmation email subject)  </td>
          <td align="left">:</td>
          <td align="left"><input name="psub" type="text" id="psub" value="<?php echo stripslashes($p_pcs);?>" /></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" valign="top" class="sltimg"><strong>*Forgot Password(Email) Message</strong><br>
            ( For forgot password request recieved   confirmation email message) </td>
          <td align="left" valign="top">:</td>
          <td align="left"><label>
            <textarea name="pmess" cols="35" rows="06" id="pmess"><?php echo stripslashes($p_pcm);?></textarea>
          </label></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" class="sltimg"><strong>*New Order Confirmation  (Email)Subject</strong> <br>
            ( For Auto response email when new order recieved ) </td>
          <td align="left">:</td>
          <td align="left"><input name="ossub" type="text" id="ossub" value="<?php echo stripslashes($p_oss);?>" /></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" valign="top" class="sltimg"><strong>*New Order Confirmation (Email)Message</strong> <br>
            ( For Auto response email when new order recieved )  </td>
          <td align="left" valign="top">:</td>
          <td align="left"><textarea name="osmess" cols="35" rows="06" id="osmess"><?php echo stripslashes($p_osm);?>
          </textarea></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" class="sltimg"><strong>Newsletter (Email)Subject</strong><br>
            ( For Newsletter  email subject) </td>
          <td align="left">:</td>
          <td align="left"><input name="nlsub" type="text" id="nlsub" value="<?php echo stripslashes($p_nls);?>" /></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" valign="top" class="sltimg"><strong>Newsletter (Email)Message</strong><br>
            ( For Newsletter  email subject message)  </td>
          <td align="left" valign="top">:</td>
          <td align="left"><textarea name="nlmess" cols="35" rows="06" id="nlmess"><?php echo stripslashes($p_nlm);?>
          </textarea></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" class="sltimg"><strong>*Thankyou Message(contact)</strong> <br>
            ( For thank you message in contact ) </td>
          <td align="left">:</td>
          <td align="left"><input name="contact" type="text" id="contact"  value="<?php echo stripslashes($p_cntmess);?>"/></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" class="sltimg"><strong>Wishlist E-Mail (Email)Subject</strong><br>
            ( For sending wishlist email subject)  </td>
          <td align="left">:</td>
          <td align="left"><input name="wishsub" type="text" id="wishsub" value="<?php echo stripslashes($p_wishsub);?>" /></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right" valign="top" class="sltimg"><strong>Wish list E-Mail (Email)Message</strong><br>
            ( For sending wishlist email message)  </td>
          <td align="left" valign="top">:</td>
          <td align="left"><textarea name="wishmess" cols="35" rows="06" id="wishmess"><?php echo stripslashes($p_wishmess);?>
          </textarea></td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="5" align="left">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="5" align="center"><input name="Submit" type="submit" class="btn" id="Submit" value="Update" /></td>
        </tr>
        <tr>
          <td colspan="5" align="center">&nbsp;</td>
        </tr>
      </table>
            </form>
    </td>
    <td width="2%">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" align="center"><?php include(INC."bottom.php");?></td>
  </tr>
</table>

</body>
</html>
